{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "provenance": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "cells": [
    {
      "cell_type": "code",
      "source": [
        "!pip install pyautogen semantic-kernel google-generativeai python-dotenv\n",
        "\n",
        "import os\n",
        "import asyncio\n",
        "from typing import Dict, Any, List\n",
        "import autogen\n",
        "import google.generativeai as genai\n",
        "from semantic_kernel import Kernel\n",
        "from semantic_kernel.functions import KernelArguments\n",
        "from semantic_kernel.functions.kernel_function_decorator import kernel_function"
      ],
      "metadata": {
        "id": "NOG16EmTJXCs"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "GEMINI_API_KEY = \"Use Your API Key Here\"\n",
        "genai.configure(api_key=GEMINI_API_KEY)\n",
        "\n",
        "config_list = [\n",
        "    {\n",
        "        \"model\": \"gemini-1.5-flash\",\n",
        "        \"api_key\": GEMINI_API_KEY,\n",
        "        \"api_type\": \"google\",\n",
        "        \"api_base\": \"https://generativelanguage.googleapis.com/v1beta\",\n",
        "    }\n",
        "]"
      ],
      "metadata": {
        "id": "4KtjnS8aJZai"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "class GeminiWrapper:\n",
        "    \"\"\"Wrapper for Gemini API to work with AutoGen\"\"\"\n",
        "\n",
        "    def __init__(self, model_name=\"gemini-1.5-flash\"):\n",
        "        self.model = genai.GenerativeModel(model_name)\n",
        "\n",
        "    def generate_response(self, prompt: str, temperature: float = 0.7) -> str:\n",
        "        \"\"\"Generate response using Gemini\"\"\"\n",
        "        try:\n",
        "            response = self.model.generate_content(\n",
        "                prompt,\n",
        "                generation_config=genai.types.GenerationConfig(\n",
        "                    temperature=temperature,\n",
        "                    max_output_tokens=2048,\n",
        "                )\n",
        "            )\n",
        "            return response.text\n",
        "        except Exception as e:\n",
        "            return f\"Gemini API Error: {str(e)}\""
      ],
      "metadata": {
        "id": "PZkhM8JrJcBb"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "class SemanticKernelGeminiPlugin:\n",
        "    \"\"\"Semantic Kernel plugin using Gemini Flash for advanced AI operations\"\"\"\n",
        "\n",
        "    def __init__(self):\n",
        "        self.kernel = Kernel()\n",
        "        self.gemini = GeminiWrapper()\n",
        "\n",
        "    @kernel_function(name=\"analyze_text\", description=\"Analyze text for sentiment and key insights\")\n",
        "    def analyze_text(self, text: str) -> str:\n",
        "        \"\"\"Analyze text using Gemini Flash\"\"\"\n",
        "        prompt = f\"\"\"\n",
        "        Analyze the following text comprehensively:\n",
        "\n",
        "        Text: {text}\n",
        "\n",
        "        Provide analysis in this format:\n",
        "        - Sentiment: [positive/negative/neutral with confidence]\n",
        "        - Key Themes: [main topics and concepts]\n",
        "        - Insights: [important observations and patterns]\n",
        "        - Recommendations: [actionable next steps]\n",
        "        - Tone: [formal/informal/technical/emotional]\n",
        "        \"\"\"\n",
        "\n",
        "        return self.gemini.generate_response(prompt, temperature=0.3)\n",
        "\n",
        "    @kernel_function(name=\"generate_summary\", description=\"Generate comprehensive summary\")\n",
        "    def generate_summary(self, content: str) -> str:\n",
        "        \"\"\"Generate summary using Gemini's advanced capabilities\"\"\"\n",
        "        prompt = f\"\"\"\n",
        "        Create a comprehensive summary of the following content:\n",
        "\n",
        "        Content: {content}\n",
        "\n",
        "        Provide:\n",
        "        1. Executive Summary (2-3 sentences)\n",
        "        2. Key Points (bullet format)\n",
        "        3. Important Details\n",
        "        4. Conclusion/Implications\n",
        "        \"\"\"\n",
        "\n",
        "        return self.gemini.generate_response(prompt, temperature=0.4)\n",
        "\n",
        "    @kernel_function(name=\"code_analysis\", description=\"Analyze code for quality and suggestions\")\n",
        "    def code_analysis(self, code: str) -> str:\n",
        "        \"\"\"Analyze code using Gemini's code understanding\"\"\"\n",
        "        prompt = f\"\"\"\n",
        "        Analyze this code comprehensively:\n",
        "\n",
        "        ```\n",
        "        {code}\n",
        "        ```\n",
        "\n",
        "        Provide analysis covering:\n",
        "        - Code Quality: [readability, structure, best practices]\n",
        "        - Performance: [efficiency, optimization opportunities]\n",
        "        - Security: [potential vulnerabilities, security best practices]\n",
        "        - Maintainability: [documentation, modularity, extensibility]\n",
        "        - Suggestions: [specific improvements with examples]\n",
        "        \"\"\"\n",
        "\n",
        "        return self.gemini.generate_response(prompt, temperature=0.2)\n",
        "\n",
        "    @kernel_function(name=\"creative_solution\", description=\"Generate creative solutions to problems\")\n",
        "    def creative_solution(self, problem: str) -> str:\n",
        "        \"\"\"Generate creative solutions using Gemini's creative capabilities\"\"\"\n",
        "        prompt = f\"\"\"\n",
        "        Problem: {problem}\n",
        "\n",
        "        Generate creative solutions:\n",
        "        1. Conventional Approaches (2-3 standard solutions)\n",
        "        2. Innovative Ideas (3-4 creative alternatives)\n",
        "        3. Hybrid Solutions (combining different approaches)\n",
        "        4. Implementation Strategy (practical steps)\n",
        "        5. Potential Challenges and Mitigation\n",
        "        \"\"\"\n",
        "\n",
        "        return self.gemini.generate_response(prompt, temperature=0.8)"
      ],
      "metadata": {
        "id": "5wuc-xgSJe5d"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "class AdvancedGeminiAgent:\n",
        "    \"\"\"Advanced AI Agent using Gemini Flash with AutoGen and Semantic Kernel\"\"\"\n",
        "\n",
        "    def __init__(self):\n",
        "        self.sk_plugin = SemanticKernelGeminiPlugin()\n",
        "        self.gemini = GeminiWrapper()\n",
        "        self.setup_agents()\n",
        "\n",
        "    def setup_agents(self):\n",
        "        \"\"\"Initialize AutoGen agents with Gemini Flash\"\"\"\n",
        "\n",
        "        gemini_config = {\n",
        "            \"config_list\": [{\"model\": \"gemini-1.5-flash\", \"api_key\": GEMINI_API_KEY}],\n",
        "            \"temperature\": 0.7,\n",
        "        }\n",
        "\n",
        "        self.assistant = autogen.ConversableAgent(\n",
        "            name=\"GeminiAssistant\",\n",
        "            llm_config=gemini_config,\n",
        "            system_message=\"\"\"You are an advanced AI assistant powered by Gemini Flash with Semantic Kernel capabilities.\n",
        "            You excel at analysis, problem-solving, and creative thinking. Always provide comprehensive, actionable insights.\n",
        "            Use structured responses and consider multiple perspectives.\"\"\",\n",
        "            human_input_mode=\"NEVER\",\n",
        "        )\n",
        "\n",
        "        self.code_reviewer = autogen.ConversableAgent(\n",
        "            name=\"GeminiCodeReviewer\",\n",
        "            llm_config={**gemini_config, \"temperature\": 0.3},\n",
        "            system_message=\"\"\"You are a senior code reviewer powered by Gemini Flash.\n",
        "            Analyze code for best practices, security, performance, and maintainability.\n",
        "            Provide specific, actionable feedback with examples.\"\"\",\n",
        "            human_input_mode=\"NEVER\",\n",
        "        )\n",
        "\n",
        "        self.creative_analyst = autogen.ConversableAgent(\n",
        "            name=\"GeminiCreativeAnalyst\",\n",
        "            llm_config={**gemini_config, \"temperature\": 0.8},\n",
        "            system_message=\"\"\"You are a creative problem solver and innovation expert powered by Gemini Flash.\n",
        "            Generate innovative solutions, think outside the box, and provide fresh perspectives.\n",
        "            Balance creativity with practicality.\"\"\",\n",
        "            human_input_mode=\"NEVER\",\n",
        "        )\n",
        "\n",
        "        self.data_specialist = autogen.ConversableAgent(\n",
        "            name=\"GeminiDataSpecialist\",\n",
        "            llm_config={**gemini_config, \"temperature\": 0.4},\n",
        "            system_message=\"\"\"You are a data analysis expert powered by Gemini Flash.\n",
        "            Identify patterns, trends, and insights in data and text.\n",
        "            Provide evidence-based recommendations and statistical perspectives.\"\"\",\n",
        "            human_input_mode=\"NEVER\",\n",
        "        )\n",
        "\n",
        "        self.user_proxy = autogen.ConversableAgent(\n",
        "            name=\"UserProxy\",\n",
        "            human_input_mode=\"NEVER\",\n",
        "            max_consecutive_auto_reply=2,\n",
        "            is_termination_msg=lambda x: x.get(\"content\", \"\").rstrip().endswith(\"TERMINATE\"),\n",
        "            llm_config=False,\n",
        "        )\n",
        "\n",
        "    def analyze_with_semantic_kernel(self, content: str, analysis_type: str) -> str:\n",
        "        \"\"\"Bridge function between AutoGen and Semantic Kernel with Gemini\"\"\"\n",
        "        try:\n",
        "            if analysis_type == \"text\":\n",
        "                return self.sk_plugin.analyze_text(content)\n",
        "            elif analysis_type == \"code\":\n",
        "                return self.sk_plugin.code_analysis(content)\n",
        "            elif analysis_type == \"summary\":\n",
        "                return self.sk_plugin.generate_summary(content)\n",
        "            elif analysis_type == \"creative\":\n",
        "                return self.sk_plugin.creative_solution(content)\n",
        "            else:\n",
        "                return \"Invalid analysis type. Use 'text', 'code', 'summary', or 'creative'.\"\n",
        "        except Exception as e:\n",
        "            return f\"Semantic Kernel Analysis Error: {str(e)}\"\n",
        "\n",
        "    def multi_agent_collaboration(self, task: str) -> Dict[str, str]:\n",
        "        \"\"\"Orchestrate multi-agent collaboration using Gemini\"\"\"\n",
        "        results = {}\n",
        "\n",
        "        agents = {\n",
        "            \"assistant\": (self.assistant, \"comprehensive analysis\"),\n",
        "            \"code_reviewer\": (self.code_reviewer, \"code review perspective\"),\n",
        "            \"creative_analyst\": (self.creative_analyst, \"creative solutions\"),\n",
        "            \"data_specialist\": (self.data_specialist, \"data-driven insights\")\n",
        "        }\n",
        "\n",
        "        for agent_name, (agent, perspective) in agents.items():\n",
        "            try:\n",
        "                prompt = f\"Task: {task}\\n\\nProvide your {perspective} on this task.\"\n",
        "                response = agent.generate_reply([{\"role\": \"user\", \"content\": prompt}])\n",
        "                results[agent_name] = response if isinstance(response, str) else str(response)\n",
        "            except Exception as e:\n",
        "                results[agent_name] = f\"Agent {agent_name} error: {str(e)}\"\n",
        "\n",
        "        return results\n",
        "\n",
        "    def run_comprehensive_analysis(self, query: str) -> Dict[str, Any]:\n",
        "        \"\"\"Run comprehensive analysis using all Gemini-powered capabilities\"\"\"\n",
        "        results = {}\n",
        "\n",
        "        analyses = [\"text\", \"summary\", \"creative\"]\n",
        "        for analysis_type in analyses:\n",
        "            try:\n",
        "                results[f\"sk_{analysis_type}\"] = self.analyze_with_semantic_kernel(query, analysis_type)\n",
        "            except Exception as e:\n",
        "                results[f\"sk_{analysis_type}\"] = f\"Error: {str(e)}\"\n",
        "\n",
        "        try:\n",
        "            results[\"multi_agent\"] = self.multi_agent_collaboration(query)\n",
        "        except Exception as e:\n",
        "            results[\"multi_agent\"] = f\"Multi-agent error: {str(e)}\"\n",
        "\n",
        "        try:\n",
        "            results[\"direct_gemini\"] = self.gemini.generate_response(\n",
        "                f\"Provide a comprehensive analysis of: {query}\", temperature=0.6\n",
        "            )\n",
        "        except Exception as e:\n",
        "            results[\"direct_gemini\"] = f\"Direct Gemini error: {str(e)}\"\n",
        "\n",
        "        return results"
      ],
      "metadata": {
        "id": "K90od2IfJhiT"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "def main():\n",
        "    \"\"\"Main execution function for Google Colab with Gemini Flash\"\"\"\n",
        "    print(\"🚀 Initializing Advanced Gemini Flash AI Agent...\")\n",
        "    print(\"⚡ Using Gemini 1.5 Flash for high-speed, cost-effective AI processing\")\n",
        "\n",
        "    try:\n",
        "        agent = AdvancedGeminiAgent()\n",
        "        print(\"✅ Agent initialized successfully!\")\n",
        "    except Exception as e:\n",
        "        print(f\"❌ Initialization error: {str(e)}\")\n",
        "        print(\"💡 Make sure to set your Gemini API key!\")\n",
        "        return\n",
        "\n",
        "    demo_queries = [\n",
        "        \"How can AI transform education in developing countries?\",\n",
        "        \"def fibonacci(n): return n if n <= 1 else fibonacci(n-1) + fibonacci(n-2)\",\n",
        "        \"What are the most promising renewable energy technologies for 2025?\"\n",
        "    ]\n",
        "\n",
        "    print(\"\\n🔍 Running Gemini Flash Powered Analysis...\")\n",
        "\n",
        "    for i, query in enumerate(demo_queries, 1):\n",
        "        print(f\"\\n{'='*60}\")\n",
        "        print(f\"🎯 Demo {i}: {query}\")\n",
        "        print('='*60)\n",
        "\n",
        "        try:\n",
        "            results = agent.run_comprehensive_analysis(query)\n",
        "\n",
        "            for key, value in results.items():\n",
        "                if key == \"multi_agent\" and isinstance(value, dict):\n",
        "                    print(f\"\\n🤖 {key.upper().replace('_', ' ')}:\")\n",
        "                    for agent_name, response in value.items():\n",
        "                        print(f\"  👤 {agent_name}: {str(response)[:200]}...\")\n",
        "                else:\n",
        "                    print(f\"\\n📊 {key.upper().replace('_', ' ')}:\")\n",
        "                    print(f\"   {str(value)[:300]}...\")\n",
        "\n",
        "        except Exception as e:\n",
        "            print(f\"❌ Error in demo {i}: {str(e)}\")\n",
        "\n",
        "    print(f\"\\n{'='*60}\")\n",
        "    print(\"🎉 Gemini Flash AI Agent Demo Completed!\")\n",
        "    print(\"💡 To use with your API key, replace 'your-gemini-api-key-here'\")\n",
        "    print(\"🔗 Get your free Gemini API key at: https://makersuite.google.com/app/apikey\")\n",
        "\n",
        "if __name__ == \"__main__\":\n",
        "    main()"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "id": "ntBHlkTOEMSY",
        "outputId": "4984f1a9-9abb-4003-8371-3bc38cef5b98"
      },
      "execution_count": 1,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "🚀 Initializing Advanced Gemini Flash AI Agent...\n",
            "⚡ Using Gemini 1.5 Flash for high-speed, cost-effective AI processing\n",
            "[autogen.oai.client: 06-22 10:15:12] {353} WARNING - The API key specified is not a valid OpenAI format; it won't work with the OpenAI-hosted model.\n"
          ]
        },
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "WARNING:autogen.oai.client:The API key specified is not a valid OpenAI format; it won't work with the OpenAI-hosted model.\n"
          ]
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "[autogen.oai.client: 06-22 10:15:12] {353} WARNING - The API key specified is not a valid OpenAI format; it won't work with the OpenAI-hosted model.\n"
          ]
        },
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "WARNING:autogen.oai.client:The API key specified is not a valid OpenAI format; it won't work with the OpenAI-hosted model.\n"
          ]
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "[autogen.oai.client: 06-22 10:15:12] {353} WARNING - The API key specified is not a valid OpenAI format; it won't work with the OpenAI-hosted model.\n"
          ]
        },
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "WARNING:autogen.oai.client:The API key specified is not a valid OpenAI format; it won't work with the OpenAI-hosted model.\n"
          ]
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "[autogen.oai.client: 06-22 10:15:12] {353} WARNING - The API key specified is not a valid OpenAI format; it won't work with the OpenAI-hosted model.\n"
          ]
        },
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "WARNING:autogen.oai.client:The API key specified is not a valid OpenAI format; it won't work with the OpenAI-hosted model.\n"
          ]
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "✅ Agent initialized successfully!\n",
            "\n",
            "🔍 Running Gemini Flash Powered Analysis...\n",
            "\n",
            "============================================================\n",
            "🎯 Demo 1: How can AI transform education in developing countries?\n",
            "============================================================\n",
            "\n",
            "📊 SK TEXT:\n",
            "   - **Sentiment:** Positive (High Confidence). The question implies a belief that AI *can* transform education, framing it as a potential positive development.\n",
            "\n",
            "- **Key Themes:**\n",
            "    * **Educational Transformation:**  The core theme revolves around improving education systems in developing countries. ...\n",
            "\n",
            "📊 SK SUMMARY:\n",
            "   ## How AI Can Transform Education in Developing Countries: A Summary\n",
            "\n",
            "**1. Executive Summary:**\n",
            "\n",
            "Artificial intelligence (AI) offers transformative potential for education in developing countries by addressing critical challenges like teacher shortages, limited access to quality resources, and perso...\n",
            "\n",
            "📊 SK CREATIVE:\n",
            "   ## AI Transforming Education in Developing Countries\n",
            "\n",
            "**Problem:** How can AI transform education in developing countries?\n",
            "\n",
            "\n",
            "**1. Conventional Approaches:**\n",
            "\n",
            "1. **Personalized Learning Platforms:**  Developing AI-powered learning platforms that adapt to individual student needs and learning styles. ...\n",
            "\n",
            "🤖 MULTI AGENT:\n",
            "  👤 assistant: Agent assistant error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: AIzaSyB7***************************H8Hs. You can find your API key at https://platform.openai.com/account/ap...\n",
            "  👤 code_reviewer: Agent code_reviewer error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: AIzaSyB7***************************H8Hs. You can find your API key at https://platform.openai.com/accoun...\n",
            "  👤 creative_analyst: Agent creative_analyst error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: AIzaSyB7***************************H8Hs. You can find your API key at https://platform.openai.com/acc...\n",
            "  👤 data_specialist: Agent data_specialist error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: AIzaSyB7***************************H8Hs. You can find your API key at https://platform.openai.com/acco...\n",
            "\n",
            "📊 DIRECT GEMINI:\n",
            "   ## AI's Transformative Potential in Education for Developing Countries\n",
            "\n",
            "Artificial intelligence (AI) holds immense potential to revolutionize education in developing countries, addressing critical challenges and fostering inclusive growth.  However, its successful implementation requires careful con...\n",
            "\n",
            "============================================================\n",
            "🎯 Demo 2: def fibonacci(n): return n if n <= 1 else fibonacci(n-1) + fibonacci(n-2)\n",
            "============================================================\n",
            "\n",
            "📊 SK TEXT:\n",
            "   - **Sentiment:** Neutral (100% confidence). The text is a purely functional code snippet; there's no expression of opinion or emotion.\n",
            "\n",
            "- **Key Themes:**  Recursion, Fibonacci sequence, Python programming. The code directly implements the recursive definition of the Fibonacci sequence.\n",
            "\n",
            "- **Insights...\n",
            "\n",
            "📊 SK SUMMARY:\n",
            "   **1. Executive Summary:**\n",
            "\n",
            "The provided code defines a recursive function `fibonacci(n)` that calculates the nth Fibonacci number.  This implementation, while concise, is inefficient for larger values of `n` due to repeated calculations.  It directly translates the mathematical definition of the Fib...\n",
            "\n",
            "📊 SK CREATIVE:\n",
            "   ## Solving the Fibonacci Sequence Problem: Beyond Recursion\n",
            "\n",
            "The provided `fibonacci(n)` function uses a recursive approach, which is elegant but highly inefficient for larger values of `n` due to repeated calculations.  Let's explore more efficient solutions.\n",
            "\n",
            "**1. Conventional Approaches:**\n",
            "\n",
            "* **I...\n",
            "\n",
            "🤖 MULTI AGENT:\n",
            "  👤 assistant: Agent assistant error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: AIzaSyB7***************************H8Hs. You can find your API key at https://platform.openai.com/account/ap...\n",
            "  👤 code_reviewer: Agent code_reviewer error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: AIzaSyB7***************************H8Hs. You can find your API key at https://platform.openai.com/accoun...\n",
            "  👤 creative_analyst: Agent creative_analyst error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: AIzaSyB7***************************H8Hs. You can find your API key at https://platform.openai.com/acc...\n",
            "  👤 data_specialist: Agent data_specialist error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: AIzaSyB7***************************H8Hs. You can find your API key at https://platform.openai.com/acco...\n",
            "\n",
            "📊 DIRECT GEMINI:\n",
            "   This code defines a function called `fibonacci(n)` that calculates the nth Fibonacci number using recursion. Let's break down its functionality, efficiency, and potential improvements.\n",
            "\n",
            "**Functionality:**\n",
            "\n",
            "The function works as follows:\n",
            "\n",
            "1. **Base Cases:** If `n` is less than or equal to 1, it retur...\n",
            "\n",
            "============================================================\n",
            "🎯 Demo 3: What are the most promising renewable energy technologies for 2025?\n",
            "============================================================\n",
            "\n",
            "📊 SK TEXT:\n",
            "   - **Sentiment:** Neutral (High Confidence). The text is a straightforward question seeking information, not expressing an opinion.\n",
            "\n",
            "- **Key Themes:** Renewable energy technologies, future trends (2025), technological promise.\n",
            "\n",
            "- **Insights:** The question highlights a current interest in and anticip...\n",
            "\n",
            "📊 SK SUMMARY:\n",
            "   ## Promising Renewable Energy Technologies for 2025: A Summary\n",
            "\n",
            "**1. Executive Summary:**  2025 will likely see continued dominance of solar and wind power, but significant advancements in other renewable technologies are expected.  These include improvements in energy storage solutions, enhanced ef...\n",
            "\n",
            "📊 SK CREATIVE:\n",
            "   ## Promising Renewable Energy Technologies for 2025\n",
            "\n",
            "**1. Conventional Approaches:**\n",
            "\n",
            "1. **Solar Photovoltaic (PV) with improved efficiency:**  Focus on developing higher-efficiency silicon-based solar cells, along with advancements in perovskite solar cells (offering potentially higher efficiencies...\n",
            "\n",
            "🤖 MULTI AGENT:\n",
            "  👤 assistant: Agent assistant error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: AIzaSyB7***************************H8Hs. You can find your API key at https://platform.openai.com/account/ap...\n",
            "  👤 code_reviewer: Agent code_reviewer error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: AIzaSyB7***************************H8Hs. You can find your API key at https://platform.openai.com/accoun...\n",
            "  👤 creative_analyst: Agent creative_analyst error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: AIzaSyB7***************************H8Hs. You can find your API key at https://platform.openai.com/acc...\n",
            "  👤 data_specialist: Agent data_specialist error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: AIzaSyB7***************************H8Hs. You can find your API key at https://platform.openai.com/acco...\n",
            "\n",
            "📊 DIRECT GEMINI:\n",
            "   Predicting the \"most promising\" renewable energy technologies for a specific year like 2025 requires considering several factors: technological maturity, cost-effectiveness, scalability, environmental impact, and policy support.  No single technology will dominate, but several are poised for signifi...\n",
            "\n",
            "============================================================\n",
            "🎉 Gemini Flash AI Agent Demo Completed!\n",
            "💡 To use with your API key, replace 'your-gemini-api-key-here'\n",
            "🔗 Get your free Gemini API key at: https://makersuite.google.com/app/apikey\n"
          ]
        }
      ]
    }
  ]
}